<!doctype html>
<html class="default no-js">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>ReadPreference | mongodb</title>
	<meta name="description" content="Documentation for mongodb">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">
	<script async src="../assets/js/search.js" id="search-script"></script>
</head>
<body>
<header>
	<div class="tsd-page-toolbar">
		<div class="container">
			<div class="table-wrap">
				<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
					<div class="field">
						<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
						<input id="tsd-search-field" type="text" />
					</div>
					<ul class="results">
						<li class="state loading">Preparing search index...</li>
						<li class="state failure">The search index is not available</li>
					</ul>
					<a href="../index.html" class="title">mongodb</a>
				</div>
				<div class="table-cell" id="tsd-widgets">
					<div id="tsd-filter">
						<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
						<div class="tsd-filter-group">
							<div class="tsd-select" id="tsd-filter-visibility">
								<span class="tsd-select-label">All</span>
								<ul class="tsd-select-list">
									<li data-value="public">Public</li>
									<li data-value="protected">Public/Protected</li>
									<li data-value="private" class="selected">All</li>
								</ul>
							</div>
							<input type="checkbox" id="tsd-filter-inherited" checked />
							<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
							<input type="checkbox" id="tsd-filter-externals" checked />
							<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
						</div>
					</div>
					<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
				</div>
			</div>
		</div>
	</div>
	<div class="tsd-page-title">
		<div class="container">
			<ul class="tsd-breadcrumb">
				<li>
					<a href="../modules.html">mongodb</a>
				</li>
				<li>
					<a href="ReadPreference.html">ReadPreference</a>
				</li>
			</ul>
			<h1>Class ReadPreference</h1>
		</div>
	</div>
</header>
<div class="container container-main">
	<div class="row">
		<div class="col-8 col-content">
			<section class="tsd-panel tsd-comment">
				<div class="tsd-comment tsd-typography">
					<div class="lead">
						<p>The <strong>ReadPreference</strong> class is a class that represents a MongoDB ReadPreference and is
						used to construct connections.</p>
					</div>
					<dl class="tsd-comment-tags">
						<dt>see</dt>
						<dd><p><a href="https://www.mongodb.com/docs/manual/core/read-preference/">https://www.mongodb.com/docs/manual/core/read-preference/</a></p>
						</dd>
					</dl>
				</div>
			</section>
			<section class="tsd-panel tsd-hierarchy">
				<h3>Hierarchy</h3>
				<ul class="tsd-hierarchy">
					<li>
						<span class="target">ReadPreference</span>
					</li>
				</ul>
			</section>
			<section class="tsd-panel-group tsd-index-group">
				<h2>Index</h2>
				<section class="tsd-panel tsd-index-panel">
					<div class="tsd-index-content">
						<section class="tsd-index-section ">
							<h3>Constructors</h3>
							<ul class="tsd-index-list">
								<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="ReadPreference.html#constructor" class="tsd-kind-icon">constructor</a></li>
							</ul>
						</section>
						<section class="tsd-index-section ">
							<h3>Properties</h3>
							<ul class="tsd-index-list">
								<li class="tsd-kind-property tsd-parent-kind-class"><a href="ReadPreference.html#hedge" class="tsd-kind-icon">hedge</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class"><a href="ReadPreference.html#maxStalenessSeconds" class="tsd-kind-icon">max<wbr>Staleness<wbr>Seconds</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class"><a href="ReadPreference.html#minWireVersion" class="tsd-kind-icon">min<wbr>Wire<wbr>Version</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class"><a href="ReadPreference.html#mode" class="tsd-kind-icon">mode</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class"><a href="ReadPreference.html#tags" class="tsd-kind-icon">tags</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#NEAREST" class="tsd-kind-icon">NEAREST</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#PRIMARY" class="tsd-kind-icon">PRIMARY</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#PRIMARY_PREFERRED" class="tsd-kind-icon">PRIMARY_<wbr>PREFERRED</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#SECONDARY" class="tsd-kind-icon">SECONDARY</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#SECONDARY_PREFERRED" class="tsd-kind-icon">SECONDARY_<wbr>PREFERRED</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#nearest" class="tsd-kind-icon">nearest</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#primary" class="tsd-kind-icon">primary</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#primaryPreferred" class="tsd-kind-icon">primary<wbr>Preferred</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#secondary" class="tsd-kind-icon">secondary</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#secondaryPreferred" class="tsd-kind-icon">secondary<wbr>Preferred</a></li>
							</ul>
						</section>
						<section class="tsd-index-section ">
							<h3>Accessors</h3>
							<ul class="tsd-index-list">
								<li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="ReadPreference.html#preference" class="tsd-kind-icon">preference</a></li>
							</ul>
						</section>
						<section class="tsd-index-section ">
							<h3>Methods</h3>
							<ul class="tsd-index-list">
								<li class="tsd-kind-method tsd-parent-kind-class"><a href="ReadPreference.html#equals" class="tsd-kind-icon">equals</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class"><a href="ReadPreference.html#isValid" class="tsd-kind-icon">is<wbr>Valid</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class"><a href="ReadPreference.html#slaveOk" class="tsd-kind-icon">slave<wbr>Ok</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class"><a href="ReadPreference.html#toJSON" class="tsd-kind-icon">toJSON</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#fromOptions" class="tsd-kind-icon">from<wbr>Options</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#fromString" class="tsd-kind-icon">from<wbr>String</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#isValid-1" class="tsd-kind-icon">is<wbr>Valid</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="ReadPreference.html#translate" class="tsd-kind-icon">translate</a></li>
							</ul>
						</section>
					</div>
				</section>
			</section>
			<section class="tsd-panel-group tsd-member-group ">
				<h2>Constructors</h2>
				<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
					<a name="constructor" class="tsd-anchor"></a>
					<h3>constructor</h3>
					<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
						<li class="tsd-signature tsd-kind-icon">new <wbr>Read<wbr>Preference<span class="tsd-signature-symbol">(</span>mode<span class="tsd-signature-symbol">: </span><a href="../modules.html#ReadPreferenceMode" class="tsd-signature-type" data-tsd-kind="Variable">ReadPreferenceMode</a>, tags<span class="tsd-signature-symbol">?: </span><a href="../modules.html#TagSet" class="tsd-signature-type" data-tsd-kind="Type alias">TagSet</a><span class="tsd-signature-symbol">[]</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/ReadPreferenceOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ReadPreferenceOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L85">src/read_preference.ts:85</a></li>
								</ul>
							</aside>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>mode: <a href="../modules.html#ReadPreferenceMode" class="tsd-signature-type" data-tsd-kind="Variable">ReadPreferenceMode</a></h5>
									<div class="tsd-comment tsd-typography">
										<div class="lead">
											<p>A string describing the read preference mode (primary|primaryPreferred|secondary|secondaryPreferred|nearest)</p>
										</div>
									</div>
								</li>
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> tags: <a href="../modules.html#TagSet" class="tsd-signature-type" data-tsd-kind="Type alias">TagSet</a><span class="tsd-signature-symbol">[]</span></h5>
									<div class="tsd-comment tsd-typography">
										<div class="lead">
											<p>A tag set used to target reads to members with the specified tag(s). tagSet is not available if using read preference mode primary.</p>
										</div>
									</div>
								</li>
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/ReadPreferenceOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ReadPreferenceOptions</a></h5>
									<div class="tsd-comment tsd-typography">
										<div class="lead">
											<p>Additional read preference options</p>
										</div>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a></h4>
						</li>
					</ul>
				</section>
			</section>
			<section class="tsd-panel-group tsd-member-group ">
				<h2>Properties</h2>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
					<a name="hedge" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> hedge</h3>
					<div class="tsd-signature tsd-kind-icon">hedge<span class="tsd-signature-symbol">:</span> <a href="../interfaces/HedgeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">HedgeOptions</a></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L64">src/read_preference.ts:64</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
					<a name="maxStalenessSeconds" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> max<wbr>Staleness<wbr>Seconds</h3>
					<div class="tsd-signature tsd-kind-icon">max<wbr>Staleness<wbr>Seconds<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L65">src/read_preference.ts:65</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
					<a name="minWireVersion" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> min<wbr>Wire<wbr>Version</h3>
					<div class="tsd-signature tsd-kind-icon">min<wbr>Wire<wbr>Version<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L66">src/read_preference.ts:66</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
					<a name="mode" class="tsd-anchor"></a>
					<h3>mode</h3>
					<div class="tsd-signature tsd-kind-icon">mode<span class="tsd-signature-symbol">:</span> <a href="../modules.html#ReadPreferenceMode" class="tsd-signature-type" data-tsd-kind="Variable">ReadPreferenceMode</a></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L62">src/read_preference.ts:62</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
					<a name="tags" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> tags</h3>
					<div class="tsd-signature tsd-kind-icon">tags<span class="tsd-signature-symbol">:</span> <a href="../modules.html#TagSet" class="tsd-signature-type" data-tsd-kind="Type alias">TagSet</a><span class="tsd-signature-symbol">[]</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L63">src/read_preference.ts:63</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="NEAREST" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> NEAREST</h3>
					<div class="tsd-signature tsd-kind-icon">NEAREST<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;nearest&quot;</span><span class="tsd-signature-symbol"> = ...</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L72">src/read_preference.ts:72</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="PRIMARY" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> PRIMARY</h3>
					<div class="tsd-signature tsd-kind-icon">PRIMARY<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;primary&quot;</span><span class="tsd-signature-symbol"> = ...</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L68">src/read_preference.ts:68</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="PRIMARY_PREFERRED" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> PRIMARY_<wbr>PREFERRED</h3>
					<div class="tsd-signature tsd-kind-icon">PRIMARY_<wbr>PREFERRED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;primaryPreferred&quot;</span><span class="tsd-signature-symbol"> = ...</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L69">src/read_preference.ts:69</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="SECONDARY" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> SECONDARY</h3>
					<div class="tsd-signature tsd-kind-icon">SECONDARY<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;secondary&quot;</span><span class="tsd-signature-symbol"> = ...</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L70">src/read_preference.ts:70</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="SECONDARY_PREFERRED" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> SECONDARY_<wbr>PREFERRED</h3>
					<div class="tsd-signature tsd-kind-icon">SECONDARY_<wbr>PREFERRED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;secondaryPreferred&quot;</span><span class="tsd-signature-symbol"> = ...</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L71">src/read_preference.ts:71</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="nearest" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> nearest</h3>
					<div class="tsd-signature tsd-kind-icon">nearest<span class="tsd-signature-symbol">:</span> <a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a><span class="tsd-signature-symbol"> = ...</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L78">src/read_preference.ts:78</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="primary" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> primary</h3>
					<div class="tsd-signature tsd-kind-icon">primary<span class="tsd-signature-symbol">:</span> <a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a><span class="tsd-signature-symbol"> = ...</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L74">src/read_preference.ts:74</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="primaryPreferred" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> primary<wbr>Preferred</h3>
					<div class="tsd-signature tsd-kind-icon">primary<wbr>Preferred<span class="tsd-signature-symbol">:</span> <a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a><span class="tsd-signature-symbol"> = ...</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L75">src/read_preference.ts:75</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="secondary" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> secondary</h3>
					<div class="tsd-signature tsd-kind-icon">secondary<span class="tsd-signature-symbol">:</span> <a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a><span class="tsd-signature-symbol"> = ...</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L76">src/read_preference.ts:76</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
					<a name="secondaryPreferred" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> secondary<wbr>Preferred</h3>
					<div class="tsd-signature tsd-kind-icon">secondary<wbr>Preferred<span class="tsd-signature-symbol">:</span> <a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a><span class="tsd-signature-symbol"> = ...</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L77">src/read_preference.ts:77</a></li>
						</ul>
					</aside>
				</section>
			</section>
			<section class="tsd-panel-group tsd-member-group ">
				<h2>Accessors</h2>
				<section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class">
					<a name="preference" class="tsd-anchor"></a>
					<h3>preference</h3>
					<ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class">
						<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> preference<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#ReadPreferenceMode" class="tsd-signature-type" data-tsd-kind="Variable">ReadPreferenceMode</a></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L135">src/read_preference.ts:135</a></li>
								</ul>
							</aside>
							<h4 class="tsd-returns-title">Returns <a href="../modules.html#ReadPreferenceMode" class="tsd-signature-type" data-tsd-kind="Variable">ReadPreferenceMode</a></h4>
						</li>
					</ul>
				</section>
			</section>
			<section class="tsd-panel-group tsd-member-group ">
				<h2>Methods</h2>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
					<a name="equals" class="tsd-anchor"></a>
					<h3>equals</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
						<li class="tsd-signature tsd-kind-icon">equals<span class="tsd-signature-symbol">(</span>readPreference<span class="tsd-signature-symbol">: </span><a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L252">src/read_preference.ts:252</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Check if the two ReadPreferences are equivalent</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>readPreference: <a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a></h5>
									<div class="tsd-comment tsd-typography">
										<p>The read preference with which to check equality</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
					<a name="isValid" class="tsd-anchor"></a>
					<h3>is<wbr>Valid</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
						<li class="tsd-signature tsd-kind-icon">is<wbr>Valid<span class="tsd-signature-symbol">(</span>mode<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L227">src/read_preference.ts:227</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Validate if a mode is legal</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> mode: <span class="tsd-signature-type">string</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>The string representing the read preference mode.</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
					<a name="slaveOk" class="tsd-anchor"></a>
					<h3>slave<wbr>Ok</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
						<li class="tsd-signature tsd-kind-icon">slave<wbr>Ok<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L236">src/read_preference.ts:236</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Indicates that this readPreference needs the &quot;slaveOk&quot; bit when sent over the wire</p>
								</div>
								<dl class="tsd-comment-tags">
									<dt>see</dt>
									<dd><p><a href="https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/#op-query">https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/#op-query</a></p>
									</dd>
								</dl>
							</div>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
					<a name="toJSON" class="tsd-anchor"></a>
					<h3>toJSON</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
						<li class="tsd-signature tsd-kind-icon">toJSON<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L257">src/read_preference.ts:257</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Return JSON representation</p>
								</div>
							</div>
							<h4 class="tsd-returns-title">Returns <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
					<a name="fromOptions" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> from<wbr>Options</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
						<li class="tsd-signature tsd-kind-icon">from<wbr>Options<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/ReadPreferenceFromOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ReadPreferenceFromOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L148">src/read_preference.ts:148</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Construct a ReadPreference given an options object.</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/ReadPreferenceFromOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ReadPreferenceFromOptions</a></h5>
									<div class="tsd-comment tsd-typography">
										<p>The options object from which to extract the read preference.</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
					<a name="fromString" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> from<wbr>String</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
						<li class="tsd-signature tsd-kind-icon">from<wbr>String<span class="tsd-signature-symbol">(</span>mode<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L139">src/read_preference.ts:139</a></li>
								</ul>
							</aside>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>mode: <span class="tsd-signature-type">string</span></h5>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <a href="ReadPreference.html" class="tsd-signature-type" data-tsd-kind="Class">ReadPreference</a></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
					<a name="isValid-1" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> is<wbr>Valid</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
						<li class="tsd-signature tsd-kind-icon">is<wbr>Valid<span class="tsd-signature-symbol">(</span>mode<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L209">src/read_preference.ts:209</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Validate if a mode is legal</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>mode: <span class="tsd-signature-type">string</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>The string representing the read preference mode.</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
					<a name="translate" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> translate</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
						<li class="tsd-signature tsd-kind-icon">translate<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">: </span><a href="../interfaces/ReadPreferenceLikeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ReadPreferenceLikeOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/ReadPreferenceLikeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ReadPreferenceLikeOptions</a></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/c9a962f1/src/read_preference.ts#L184">src/read_preference.ts:184</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Replaces options.readPreference with a ReadPreference instance</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>options: <a href="../interfaces/ReadPreferenceLikeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ReadPreferenceLikeOptions</a></h5>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <a href="../interfaces/ReadPreferenceLikeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ReadPreferenceLikeOptions</a></h4>
						</li>
					</ul>
				</section>
			</section>
		</div>
		<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
			<nav class="tsd-navigation primary">
				<ul>
					<li class=" ">
						<a href="../modules.html">Exports</a>
					</li>
				</ul>
			</nav>
			<nav class="tsd-navigation secondary menu-sticky">
				<ul class="before-current">
				</ul>
				<ul class="current">
					<li class="current tsd-kind-class">
						<a href="ReadPreference.html" class="tsd-kind-icon">Read<wbr>Preference</a>
						<ul>
							<li class=" tsd-kind-constructor tsd-parent-kind-class">
								<a href="ReadPreference.html#constructor" class="tsd-kind-icon">constructor</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class">
								<a href="ReadPreference.html#hedge" class="tsd-kind-icon">hedge</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class">
								<a href="ReadPreference.html#maxStalenessSeconds" class="tsd-kind-icon">max<wbr>Staleness<wbr>Seconds</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class">
								<a href="ReadPreference.html#minWireVersion" class="tsd-kind-icon">min<wbr>Wire<wbr>Version</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class">
								<a href="ReadPreference.html#mode" class="tsd-kind-icon">mode</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class">
								<a href="ReadPreference.html#tags" class="tsd-kind-icon">tags</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#NEAREST" class="tsd-kind-icon">NEAREST</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#PRIMARY" class="tsd-kind-icon">PRIMARY</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#PRIMARY_PREFERRED" class="tsd-kind-icon">PRIMARY_<wbr>PREFERRED</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#SECONDARY" class="tsd-kind-icon">SECONDARY</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#SECONDARY_PREFERRED" class="tsd-kind-icon">SECONDARY_<wbr>PREFERRED</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#nearest" class="tsd-kind-icon">nearest</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#primary" class="tsd-kind-icon">primary</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#primaryPreferred" class="tsd-kind-icon">primary<wbr>Preferred</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#secondary" class="tsd-kind-icon">secondary</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#secondaryPreferred" class="tsd-kind-icon">secondary<wbr>Preferred</a>
							</li>
							<li class=" tsd-kind-get-signature tsd-parent-kind-class">
								<a href="ReadPreference.html#preference" class="tsd-kind-icon">preference</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class">
								<a href="ReadPreference.html#equals" class="tsd-kind-icon">equals</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class">
								<a href="ReadPreference.html#isValid" class="tsd-kind-icon">is<wbr>Valid</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class">
								<a href="ReadPreference.html#slaveOk" class="tsd-kind-icon">slave<wbr>Ok</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class">
								<a href="ReadPreference.html#toJSON" class="tsd-kind-icon">toJSON</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#fromOptions" class="tsd-kind-icon">from<wbr>Options</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#fromString" class="tsd-kind-icon">from<wbr>String</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#isValid-1" class="tsd-kind-icon">is<wbr>Valid</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
								<a href="ReadPreference.html#translate" class="tsd-kind-icon">translate</a>
							</li>
						</ul>
					</li>
				</ul>
				<ul class="after-current">
				</ul>
			</nav>
		</div>
	</div>
</div>
<footer class="with-border-bottom">
	<div class="container">
		<h2>Legend</h2>
		<div class="tsd-legend-group">
			<ul class="tsd-legend">
				<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
				<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
				<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
				<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
				<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
				<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
			</ul>
		</div>
	</div>
</footer>
<div class="container tsd-generator">
	<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
</body>
</html>